package com.zlc.platform.controller;


import com.zlc.common.core.sys.model.vo.MayanUserDataVo;
import com.zlc.platform.service.UserDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "用户个人数据")
@RestController
@Slf4j
@RequestMapping("/api/userdata")
public class UserDataController {

    @Autowired
    private UserDataService userDataService;

    /**
     * 添加个人数据
     */
    @ApiOperation(value = "添加个人数据")
    @PostMapping(value = "/add")
    public void add(@RequestBody MayanUserDataVo userData){
        userDataService.add(userData);
    }

    /**
     * 查询个人数据
     */
    @ApiOperation(value = "查询个人数据")
    @PostMapping(value = "/getUserData")
    public MayanUserDataVo getUserData(@RequestBody MayanUserDataVo userData){
        return userDataService.getUserData(userData);
    }
}
